package basic;

/**
 * @ClassName: SwitchCaseTest
 * @Author: fanfan
 * @CreateTime: 2023-04-01  16:37
 * @Description: TODO
 * @Version: 1.0
 */
public class SwitchCaseTest {
    public static void main(String[] args) {
        // 注意switch有穿透效果哦，当省略break的时候
        // switch表达式类型只能是特定的数据类型 byte short char int 枚举 String
        int num = 2;
        switch (num){
            case 1:
                System.out.println("num = " + num);
                break;
            case 2:
                System.out.println("num = " + num);
                break;
            default:
                System.out.println("没有匹配上哦");
        }
    }
}
